package com.nuance.assignment.fileInfo.server.validation.validator;

import java.io.File;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import com.nuance.assignment.fileInfo.server.validation.constraints.IsDirectory;

public class IsDirectoryValidator implements
		ConstraintValidator<IsDirectory, String> {

	@Override
	public void initialize(IsDirectory constraintAnnotation) {
		
	}

	@Override
	public boolean isValid(String value, ConstraintValidatorContext context) {
		return new File(value).isDirectory();
	}

	
}
